Skip to content

Trust Layer — JWS, Auth, Audit#31

Merged
github-actions[bot] merged 1 commit intometa/17from
claude/17-issue-14-20260410-2337
Apr 10, 2026
Merged

Trust Layer — JWS, Auth, Audit#31
github-actions[bot] merged 1 commit intometa/17from
claude/17-issue-14-20260410-2337

Conversation

@github-actions
Copy link
Copy Markdown

fixes #14

…y protection

Implements the @openthreads/trust package and server integration for Issue 14.

packages/trust:
- JWS signing via Web Crypto API (ES256/ECDSA P-256) — no external deps
  signIntent/signResponse bind intent → response into a verifiable evidence chain
- Replay protection: ReplayGuard with nonce store + timestamp validation
- Audit logging: AuditLogger + InMemoryAuditStorage + AuditStorageAdapter interface
- Strong auth: TOTP (RFC 6238 via Web Crypto HMAC-SHA1), WebAuthn challenge gen/verify
- AuthChallengeManager: issue + verify challenges (webauthn, totp, sms_otp)
- TrustLayerManager: single entry point wiring all subsystems together
  Auto-generates ES256 key pair; enabled=false means zero overhead

packages/server:
- GET /api/audit: query audit log (turnId, threadId, eventType, date range filters)
- POST /api/form/:key/auth: issue auth challenge before form submission
- PUT  /api/form/:key/auth: verify challenge (TOTP code or WebAuthn assertion)
- Form GET: returns requiresAuth=true + emits intent_rendered audit event
- Form POST: requires verified challengeId when TRUST_LAYER_ENABLED=true
- TrustLayerManager singleton (globalThis) with MongoDB-backed audit storage
- audit_log MongoDB collection with indexes

Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@github-actions github-actions Bot merged commit 38cf35b into meta/17 Apr 10, 2026
@claude claude Bot mentioned this pull request Apr 10, 2026
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants